home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
tasking.arc
/
CLOCKUTI.MOD
< prev
next >
Wrap
Text File
|
1986-03-11
|
1KB
|
41 lines
IMPLEMENTATION MODULE ClockUtilities;
FROM TimeDate IMPORT Time, GetTime;
FROM DateUtilities IMPORT DateDifference;
PROCEDURE TimeDifference( start, end: Time): REAL;
VAR
days, dif1, dif2: REAL;
BEGIN
IF start.day = end.day THEN
days := 0.0;
ELSIF start.day < end.day THEN
days := FLOAT(DateDifference(start, end));
ELSE
days := - FLOAT(DateDifference(end, start));
END;
IF end.minute >= start.minute THEN
dif1 := FLOAT( end.minute - start.minute );
ELSE
dif1 := - FLOAT( start.minute - end.minute );
END;
IF end.millisec >= start.millisec THEN
dif2 := FLOAT( end.millisec - start.millisec );
ELSE
dif2 := - FLOAT( start.millisec - end.millisec );
END;
RETURN (days * 1440.0 + dif1) * 60.0 + dif2 / 1000.0;
END TimeDifference;
PROCEDURE Pause(secs: REAL);
VAR
start, end: Time;
BEGIN
GetTime(start);
REPEAT
GetTime(end);
UNTIL TimeDifference(start,end) >= secs;
END Pause;
END ClockUtilities.